﻿#include<stdio.h>
int main()
{
	//// + 和 - 操作符
	//int a = 15 + 6;
	//int b = 15 - 6;
	//int c = 6 + 15;
	//int d = 6 - 15;
	//printf("a = %d\n", a);
	//printf("b = %d\n", b);
	//printf("c = %d\n", c);
	//printf("d = %d\n", d);
	//// * 操作符
	//int x = 5;
	//int y = 6;
	//printf("%d\n", x * y);
	//printf("%d\n", x * x);
	///// 操作符
	//int e = 10;
	//int f = 2;
	//int g = 3;
	//float v = 6/ 4;
	//float z = 6.0f/4;
	//printf("e / f = %d\n", e / f);
	//printf("e / g = %d\n", e / g);
	//printf("v = %f\n", v);//两侧都为整数，得出来的必然也是整数
	//printf("z = %f\n", z);//两侧至少有一个浮点数，得出来的即为浮点数


	///*int score = 5;
	//score = (score / 20) * 100;
	//printf("score = %d\n", score);*///得到结果是0，score / 20 是整除，会得到⼀个整数值 0 ，所以乘以 100 后得到的也是 0 
	//int score = 5;
	//score = (score / 20.0) * 100;
	//printf("score = %d\n", score);

	//int i = 6 % 4;
	//printf("i = %d\n", i);
	
	//printf("%d\n", 11 % 5);
	//printf("%d\n", -11 % 5);
	//printf("%d\n", 11 % -5);
	//printf("%d\n", -11 % -5);

	//int a = 100;//初始化
	//a = 200;	//赋值

	////前置++
	//int a = 5;
	//int b = ++a;
	//printf("%d,%d\n", a, b);
	//后置++
	//int a = 5;
	//int b = a++;
	//printf("%d,%d\n", a, b);

	int x = 5.12;//会出现警告：.c(57,10): warning C4244: “初始化”: 从“double”转换到“int”，可能丢失数据
	int y = (int)x;
	printf("x = %d\n", x);
	printf("y = %d\n", y);

	return 0;
}